package com.imooc.bilibili.dao;

import com.imooc.bilibili.domain.UserFollowing;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserFollowingDao {

    /**
     * 通过用户id和被关注用户id删除关注信息
     * @param userId
     * @param followingId
     * @return
     */
    Integer deleteUserFollowing(@Param("userId") Long userId, @Param("followingId") Integer followingId);

    /**
     * 添加用户关注
     * @param userFollowing
     * @return
     */
    Integer addUserFollowing(UserFollowing userFollowing);

    /**
     * 通过userId查询关注的列表
     * @param userId
     * @return
     */
    List<UserFollowing> getUserFollowings(Long userId);

    /**
     * 获取用户粉丝列表
     * @param followingId
     * @return
     */
    List<UserFollowing> getUserFans(Long followingId);
}
